#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m,a[100005],ans=0;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin >> n ;
    for (int i=0;i<n;i++){
        ll k;
        cin >> k;
        a[k]++;
    }
    int l;
    for (l=0;l<100004;l++) if (a[l]) break;
    int o=l;
    for (int i=o+1;i<100004;i++){
        if (0==a[i])continue;
        if (a[i]>=a[l]){
            a[l]=0;
            l=i;
        } else a[i]=0;
    }
    for (int i=0;i<100004;i++) ans+=a[i];
    cout << ans;
    return 0;
}
